// 大学搜索路由
var express = require("express");
var router = express.Router();
const Result = require("../utils/result");
const collegeService = require("../services/collegeService");

router.get("/list", async function (req, res) {
  let { keyword, page, size } = req.query;
  page = Number(page);
  size = Number(size);
  const { rows, count } = await collegeService.list(keyword, page, size);
  res.json(Result.success({ collegeArr: rows, count }));
});

module.exports = router;
